Skip to content

feat: add Actor task publication endpoints - #989

Open
Janjiran wants to merge 3 commits into
masterfrom
feat/task-publication
Open

feat: add Actor task publication endpoints#989
Janjiran wants to merge 3 commits into
masterfrom
feat/task-publication

Conversation

@Janjiran

@Janjiran Janjiran commented Aug 3, 2026

Copy link
Copy Markdown

Part of https://github.com/apify/apify-core/issues/29471

Add ability to publish and un-publish tasks via new API

Blocked by https://github.com/apify/apify-core/pull/29623

@Janjiran Janjiran added this to the 146th sprint - Growth team milestone Aug 3, 2026
@Janjiran
Janjiran requested review from B4nan and katzino August 3, 2026 06:16
@Janjiran Janjiran self-assigned this Aug 3, 2026
@Janjiran Janjiran added the t-growth Issues owned by the Growth team. label Aug 3, 2026
@github-actions github-actions Bot added the tested Temporary label used only programatically for some analytics. label Aug 3, 2026
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

⚠️ There are broken links in the documentation.

See more at https://github.com/apify/apify-client-js/actions/runs/30812758842#summary-91683107965

@Janjiran

Janjiran commented Aug 3, 2026

Copy link
Copy Markdown
Author

⚠️ There are broken links in the documentation.

See more at https://github.com/apify/apify-client-js/actions/runs/30789669108#summary-91610366020

Waiting for apify/apify-docs#2840

categorization?: string | null;
inputSchemaFields?: string[] | null;
datasetName?: string | null;
datasetView?: string | null;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important: You're missing highlightedFields?: string[] | null as far as I remember

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's stale no? I don't think it's used anywhere and if we decide to use it, the I would add it to public facing API, wdyt?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, good catch I guess we kept duplicated field to inputSchemaFields. No idea how that happened, we should remove it then.

Comment thread src/resource_clients/task.ts
Comment thread src/resource_clients/task.ts Outdated
Comment on lines +73 to +74
* The task's Actor must be public and the task must have its public display configuration
* (`publicConfig`) set up via {@apilink TaskClient.update}.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: I would also mention that you need write access to the Actor.

Comment thread src/resource_clients/task.ts Outdated
export type TaskUpdateData = Partial<
Pick<Task, 'name' | 'title' | 'description' | 'options' | 'input' | 'actorStandby'>
>;
> & { publicConfig?: Omit<TaskPublicConfig, 'publishedAt'> | null };

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: | null suggests that you can nullify this publicConfig object which you technically can't (we just ignore it while updating the rest) so I would probably drop it here and also in apify-core, WDYT?

@Janjiran
Janjiran requested a review from katzino August 3, 2026 12:53

@katzino katzino left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, two comments, mostly informative ones.

categorization?: string | null;
inputSchemaFields?: string[] | null;
datasetName?: string | null;
datasetView?: string | null;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, good catch I guess we kept duplicated field to inputSchemaFields. No idea how that happened, we should remove it then.

@@ -317,7 +381,7 @@ export interface TaskOptions {
*/
export type TaskUpdateData = Partial<

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: I commented on it at https://github.com/apify/apify-core/pull/29623#discussion_r3682214152 - TaskCreateData extends this type that means create method takes publicConfig but the endpoint in apify-core currently won't set it. Should be addressed there, not a blocker in this PR.

Comment thread test/tasks.test.ts
validateRequest({ query: {}, params: { taskId } });
});

test('unpublish() works', async () => {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this dependent on the previous test? Ideally, tests should work in isolation, if they are dependent, maybe just merge them to a single test case

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

t-growth Issues owned by the Growth team. tested Temporary label used only programatically for some analytics.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants